﻿using System;
using System.Collections.Generic;
using System.Web;

namespace ControlLibrary
{
    public class DBHelper
    {
        public bool S(SqlTransaction tran)
        {
            bool returnValue 

            bool newTran = tran == null;

            SqlConnection con = null;

            if (newTran)
            {
                con = new SqlConnection("Server=192.168.88.29\\sqlserver2005;Database=sjsm;Uid=sa;Pwd=sjsm2005");
                con.Open();
            }
            SqlTransaction t = tran ?? con.BeginTransaction();

            try
            {
                if (newTran)
                {
                    t.Commit();
                }
            }
            catch (Exception)
            {
                tran.Rollback();
            }
            finally
            {
                if (newTran)
                {
                    t.Connection.Close();
                }
            }
            return 
            return 
        }
    }
}